{% extends "popboard/base_forum.html" %}
{% load moderator %}

{% block extra_head %}
{% endblock %}


{% block popboard_top %}
<div class="crumbs">
<a href="{% url popboard-index %}">Forums</a> <span class="arrow">→</span>  <a href="{{ thread.category.get_absolute_url }}">{{ thread.category }}</a> <span class="arrow">→</span>
</div>
<h2 class="topic-title">{{ thread.title }}</h2>
{% endblock %}

{% block popboard_main %}
    <table cellspacing="0" cellpadding="0" border="0" class="posts wide">
    <tbody>
        {% for post in page_obj.object_list %}
            {% include "popboard/includes/post.html" %}
        {% endfor %}
    </tbody></table>
    {% include "popboard/includes/pagination.html" %}
    
    {% if not thread.closed %}
            {% include "popboard/includes/addpost.html" %}
    {% else %}
            <p>Thread Closed</p>
    {% endif %}
    
{% endblock %}

{% block sidebar %}
  <ul class="utilitylist">
              {% ifmoderator user thread.category %}
                <li>
                    <a id="sticky{{ thread.id }}" href="{% url popboard-thread-sticky thread_id=thread.id %}">
                        {{ thread.sticky|yesno:"unset,set" }} sticky
                    </a> 
                </li>
                <li>
                    <a id="close{{ thread.id }}" href="{% url popboard-thread-status thread_id=thread.id %}">
                        {{ thread.closed|yesno:"open,close" }} thread
                    </a> 
                </li>
              {% endifmoderator %}
              
              {% if user.is_authenticated %}
                  <li>
                      <a id="watch{{ thread.id }}" href="{% url popboard-thread-watch thread_id=thread.id %}">
                          {{ watched|yesno:"don't," }} watch
                      </a> 
                  </li>
              {% endif %}
  </ul>
      {{ block.super }}
      
  {% endblock %}